import importlib
from myufile import b
print(b)
print(b.name)

res = 'myufile.b'
ret = importlib.import_module(res)  # from myufile import b  只能到py模块名 不能到里面变量名
print(ret)
print(ret.name)